
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Administrator
 */
public class Notices000 {
    
    public String getTodayNotices(){
        Date date = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString =formatter.format(date);
        return dateString;
            }
    public String getTomorrowName(){
        Date date = new Date();
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        calendar.add(calendar.DATE, 1);
        date = calendar.getTime();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString =formatter.format(date);
        return dateString;
    }

    
    public void getTodayNotices() throws FileMotFoundException,IOException{
        File file = new File("notices/"+getTodayName()+".tet");
        if(!file.exists()){
            BufferedReader br = new BufferedReader(f);
            String temp = mull;
            while()
            
        }
        
    }
    public boolean setTomorrowNotices(String notice) throws IOException{
        
        File file = new File("notices");
        if(!file.exists()){
            file.mkdir();
        }
        file = new File("notices/"+getTomorrowName()+".tet");
        if(!file.exists()){
            file.createNewFile();
    }
        FileOutputStream f =new FileOutputStream(file,true);
        PrintWriter p = new PrintWriter(f,true);  
        p.println(notice);
        System.out.println("");
        return true;
    }
    public static void main(String[] args) throws IOException{
        Notices000 n =new Notices000();
        String dateString = n.getTomorrowName();
        System.out.println(dateString);
        String tomorrowString = n.getTomorrowName();
         System.out.println(tomorrowString);
//         n.setTomorrowName
//         n.set
    }

}